#include <string.h>
#include "config.h"
#include "InternalFlash.h"


SystemConfig_st gxSystemConfig;


SystemConfig_st xGetSystemConfigInfo( void )
{
    return gxSystemConfig;
}


void vUpdate_Save_System_Config_Params( void )
{
    gxSystemConfig.ucSaveFlag = 0x01;

    Internal_Flash_Write( mSYSTEM_CONFIG_PARAMS_SAVE_ADDR, ( uint8_t * )( &gxSystemConfig ), sizeof( SystemConfig_st ) );

    return;
}

void vRead_System_Config_Params( void )
{
    Internal_Flash_Read( mSYSTEM_CONFIG_PARAMS_SAVE_ADDR, ( uint8_t * )( &gxSystemConfig ), sizeof( SystemConfig_st ) );

    if( gxSystemConfig.ucSaveFlag != 0x01 )
    {
        vUpdate_Save_System_Config_Params( );
    }
    
    return;
}























